
{literal}

<script>

$(document).ready(function() { 
	    
    $('#file_upload').uploadify({
          'uploader'  : '/public/scripts/uploadify.swf',
          'script'    : '/upload',
          'cancelImg' : '/public/scripts/cancel.png',
          'auto'      : false,
          'method'	  : 'post',
          'multi'	:	false,
          'onComplete'  : function(event, ID, fileObj, response, data) {
          		
          		var obj = jQuery.parseJSON(response);
          		$('#filesId1').val(obj.filesId);
          		$("#uploadBox").html('<img src="/minigen.php?filepath='+obj.path+'&filename='+obj.name+'&width=80&height=80&ext='+obj.ext+'" alt="laptop"/>');
          		//alert($('#filesId').val());
			},
			'onError'     : function (event,ID,fileObj,errorObj) {
			      alert(errorObj.type + ' Error: ' + errorObj.info);
			},
			'scriptData'  : {{/literal}'fileTypesId':'{$fileTypesId}', 'sessionId': '{$sessionId}','destination': '{$uploadDestination}'{literal}}
		
    });
    
    $('#file_upload2').uploadify({
          'uploader'  : '/public/scripts/uploadify.swf',
          'script'    : '/upload',
          'cancelImg' : '/public/scripts/cancel.png',
          'auto'      : false,
          'method'	  : 'post',
          'multi'	:	false,
          'onComplete'  : function(event, ID, fileObj, response, data) {
          		
          		var obj = jQuery.parseJSON(response);
          		$('#filesId2').val(obj.filesId);
          		$("#uploadBox2").html('<img src="/minigen.php?filepath='+obj.path+'&filename='+obj.name+'&width=80&height=80&ext='+obj.ext+'" alt="laptop"/>');
          		//alert($('#filesId').val());
			},
			'onError'     : function (event,ID,fileObj,errorObj) {
			      alert(errorObj.type + ' Error: ' + errorObj.info);
			},
			'scriptData'  : {{/literal}'fileTypesId':'{$fileTypesId}', 'sessionId': '{$sessionId}','destination': '{$uploadDestination}'{literal}}
		
    });
    
    $('#file_upload3').uploadify({
          'uploader'  : '/public/scripts/uploadify.swf',
          'script'    : '/upload',
          'cancelImg' : '/public/scripts/cancel.png',
          'auto'      : false,
          'method'	  : 'post',
          'multi'	:	false,
          'onComplete'  : function(event, ID, fileObj, response, data) {
          		
          		var obj = jQuery.parseJSON(response);
          		$('#filesId3').val(obj.filesId);
          		$("#uploadBox3").html('<img src="/minigen.php?filepath='+obj.path+'&filename='+obj.name+'&width=80&height=80&ext='+obj.ext+'" alt="laptop"/>');
          		//alert($('#filesId').val());
			},
			'onError'     : function (event,ID,fileObj,errorObj) {
			      alert(errorObj.type + ' Error: ' + errorObj.info);
			},
			'scriptData'  : {{/literal}'fileTypesId':'{$fileTypesId}', 'sessionId': '{$sessionId}','destination': '{$uploadDestination}'{literal}}
		
    });
});

</script>

<style>


</style>
{/literal}
{strip}

<div id="content">
    <div id="content_left">
    	<h1>Create new offer</h1>
    	<div id="offer_form">
    		<form method="POST" action="/account/save-offer">
    			<div class="offer_form_title">
    			<div class="title">
    				I will <input type="text" maxlength="200" value="{$title}" name="addForm[title]" /> for &euro; 5
    				<div class="instructions">
    					max chars: 200
    				</div>
    			</div>
    			</div>
    			<div class="offer_form_content">
	    			<div class="left left_side">
	    				Category
	    			</div>
	    			<div class="left">
	    				<select name="addForm[categoriesId]">
	    					{foreach $categories as $c}
	    						<option value="{$c->getId()}">{$c->getCategory()}</option>
	    					{/foreach}
	    				</select>
	    			</div>
	    			<div class="clear"></div>
	    			
					<div class="left left_side">
	    				Offer type
	    			</div>
	    			<div class="left">
	    				<select name="addForm[offersTypesId]">
	    					{foreach $offerTypes as $ot}
	    						<option value="{$ot->getId()}">{$ot->getType()}</option>
	    					{/foreach}
	    				</select>
	    			</div>
	    			<div class="clear"></div>
	    			
	    			<div class="left left_side">
	    				Teaser
	    			</div>
	    			<div class="left right_side">
	    				<textarea rows="3" name="addForm[teaser]"></textarea> 
	    				<div class="instructions">
	    					max chars: 300
	    				</div>
	    			</div>
	    			<div class="clear"></div>
	    			
	    			<div class="left left_side">
	    				Description
	    			</div>
	    			<div class="left right_side">
	    				<textarea rows="10" name="addForm[description]"></textarea>
	    				<div class="instructions">
	    					max chars: 500
	    				</div>
	    			
	    			</div>
	    			<div class="clear"></div>
	    			
	    			<div class="left left_side">
	    				Instructions to Buyer
	    			</div>
	    			<div class="left right_side">
	    				<textarea rows="10" name="addForm[instruction]"></textarea>
	    				<div class="instructions">
	    					max chars: 500
	    				</div>
	    			</div>
	    			<div class="clear"></div>
	    			
	    			<div class="left left_side">
	    				Tags
	    			</div>
	    			<div class="left right_side">
	    				<textarea rows="3" name="addForm[tags]"></textarea>
	    				<div class="instructions">
	    					max chars: 150
	    				</div>
	    			</div>
	    			
	    			<div class="clear"></div>
	    			
	    			<div class="left left_side">
	    				Maximum days to complete
	    			</div>
	    			<div class="left right_side">
	    				<div class="left">
		    				<select name="addForm[realizationDays]">
		    					{section  name=foo start=1 loop=31 step=1}
		    					<option value="{$smarty.section.foo.index}">{$smarty.section.foo.index}</option>
		    					{/section}
		    				</select>
		    			</div>
	    				<div class="instructions">
		    				Maximum duration for this gig to complete. time it will take you to complete your work.
							<br /><br />
							Consider the following factors:
							Time differences, your own free time and other engagements.
							<br /><br />
							FYI: Buyers are allowed to cancel late delivered orders.
						</div>
						<div class="clear"></div>
	    			</div>
	    			<div class="clear"></div>
	    			
	    			<div class="left left_side">
	    				Add image
	    				<div id="uploadBox" class="form_image"></div>
	    			</div>
	    			<div class="left right_side">
	    				<br />
						<div id="uploadComponent">
							<input id="file_upload" name="file_upload" type="file" />
							<a href="javascript:$('#file_upload').uploadifyUpload();">Upload File</a>
						</div>
	    			</div>
	    			
	    			<div class="clear"></div>
	    			
	    			{literal}
	    			
	    				<script>
	    					function showIDetails(obj){
	    						if (obj.checked == true)
	    							$('#iDetails').css('display', 'block');
	    						else
	    							$('#iDetails').css('display', 'none'); 
	    					}
	    					
	    					function showSDetails(obj){
	    						if (obj.checked == true)
	    							$('#sDetails').css('display', 'block');
	    						else
	    							$('#sDetails').css('display', 'none'); 
	    					}
	    				</script>
	    			{/literal}
	    			<div class="offer_form_content">
		    			<input type="checkbox" id="moreImages" value="1" onclick="showIDetails(this);" class="pointer"/> add more images
		    			<div id="iDetails" style="display: none;"> 
			    			<div class="left left_side">
			    				
			    				<div id="uploadBox2" class="form_image"></div>
			    			</div>
			    			<div class="left right_side">
			    				
								<div id="uploadComponent">
									<input id="file_upload2" name="file_upload2" type="file" />
									<a href="javascript:$('#file_upload2').uploadifyUpload();">Upload File</a>
								</div>
			    			</div>
			    			<div class="clear"></div>
			    			
			    			<div class="left left_side">
			    				
			    				<div id="uploadBox3" class="form_image"></div>
			    			</div>
			    			<div class="left right_side">
			    				
								<div id="uploadComponent">
									<input id="file_upload3" name="file_upload3" type="file" />
									<a href="javascript:$('#file_upload3').uploadifyUpload();">Upload File</a>
								</div>
			    			</div>
			    			<div class="clear"></div>
		    			</div>
		    			<div class="clear"></div>
	    			</div>
	    			
	    			<div class="left">
	    				<div class="shipping_details">
	    				<input type="checkbox" id="requireShipping" value="1" onclick="showSDetails(this);" class="pointer"/>&nbsp;This item requires shipping
		    				<div class="left" id="sDetails" style="display: none;margin: 0px;">
		    					<p style="color: red; padding: 0px; margin: 0px; text-align: left; font-size: 9pt; padding-bottom: 10px;">Charging shipping fees for non-shippable items may get your gig rejected.</p>
		    					<br />
		    					I charge <select name="addForm[shippingPrice]" style="width: 80px;" class="pointer">
		    								<option value="0.00">nothing</option>
		    								<option value="0.90">0.90&euro;</option>
		    								<option value="1.80">1.80&euro;</option>
		    								<option value="2.70">2.70&euro;</option>
		    								<option value="3.60">3.60&euro;</option>
		    								<option value="4.50">4.50&euro;</option>
		    								<option value="5.40">5.40&euro;</option>
		    								<option value="6.30">6.30&euro;</option>
		    								<option value="7.20">7.20&euro;</option>
		    								<option value="8.10">8.10&euro;</option>
		    								<option value="9.00">9.00&euro;</option>
		    								
		    							</select> to ship to <select name="addForm[countrySelected]" style="width: 160px;" class="pointer">
		    								{foreach $countries as $country}
		    									<option value="{$country->getCountry()}" {if $country->getCountry() == 'Poland'}selected{/if}>{$country->getCountry()}</option>
		    								{/foreach}
		    							</select><br /> and <select name="addForm[additionalShippingPrice]" style="width: 80px;" class="pointer">
		    								<option value="0.00">nothing</option>
		    								<option value="0.90">0.90&euro;</option>
		    								<option value="1.80">1.80&euro;</option>
		    								<option value="2.70">2.70&euro;</option>
		    								<option value="3.60">3.60&euro;</option>
		    								<option value="4.50">4.50&euro;</option>
		    								<option value="5.40">5.40&euro;</option>
		    								<option value="6.30">6.30&euro;</option>
		    								<option value="7.20">7.20&euro;</option>
		    								<option value="8.10">8.10&euro;</option>
		    								<option value="9.00">9.00&euro;</option>
		    								
		    							</select> to anywhere else in the world.
		    							<p class="instructions">
		    								* Net shipping prices, not including minor PayPal withdrawal fees, according with our <a href="/terms">Terms of Service</a>
		    							</p>
		    							
		    				</div>
		    				<div class="clear"></div>
	    				</div>
	    			</div>
    			
    			</div>
    			<div class="clear"></div>
    			<input type="hidden" name="addForm[offersId]" value="0"/>
    			<input id="filesId1" type="hidden" name="addForm[filesId][0]" value=""/>
    			<input id="filesId2" type="hidden" name="addForm[filesId][1]" value=""/>
    			<input id="filesId3" type="hidden" name="addForm[filesId][2]" value=""/>
    			
    			<input type="submit" value="Submit offer" class="right pointer"/>
    			<div class="clear"></div>
    		</form>
    	</div>
	</div>
	<div id="content_right">
		{include file='account/menu.tpl'}
	</div>
</div>
<!-- end content  -->


{/strip}